from django.db import models

# Create your models here.

class Admin(models.Model):
    '''管理员表'''
    ad_name = models.CharField(verbose_name='管理员姓名',max_length=16)
    ad_password = models.CharField(verbose_name='密码',max_length=32)

class Students(models.Model):
    '''学生信息表'''
    s_id = models.CharField(verbose_name='学号',max_length=32,unique=True)
    s_name = models.CharField(verbose_name='学生姓名',max_length=16)
    s_sex = models.CharField(verbose_name='学生性别',max_length=8)
    s_age = models.CharField(verbose_name='学生年龄',max_length=8)
    s_college = models.CharField(verbose_name='所属学院',max_length=16)
    s_speciality = models.CharField(verbose_name='学生专业',max_length=16)
    s_phone = models.CharField(verbose_name='学生联系方式',max_length=32)
    s_adress = models.CharField(verbose_name='家庭住址',max_length=64)
    depart = models.ForeignKey(verbose_name='宿舍号',to='Depart',on_delete=models.CASCADE)
    def __str__(self):
        return self.s_name

class Depart(models.Model):
    '''宿舍信息表'''
    d_people = models.CharField(verbose_name='已住人员',max_length=32)
    d_college = models.CharField(verbose_name="所属专业",max_length=16)